/**
 * @author Tobias Boehm
 *
 * 25.03.2011
 */
package org.anddev.andengine.extension.tbsengine.resource;

import org.anddev.andengine.entity.sprite.Sprite;


/**
 * This is an abstract base type for all kinds of resources you may want to 
 * implement into your game.
 * <p>
 * Your implementation of this class should be the basis of all specific 
 * implementations of resources. You may want to implement some static methods 
 * for querying a specific resource type through an public static enum type.
 * 
 * @author Tobias Boehm
 *
 */
public abstract class AbsBaseResourceType {

	protected String mID = this.initID();
	protected String mName = this.initName();
	protected String mDescription = this.initDescription();
	protected Sprite mIcon = this.initIcon();
	
	protected abstract String initID();
	
	protected abstract  Sprite initIcon();

	protected abstract String initDescription();
	
	protected abstract String initName();
	
	@Override
	public int hashCode() {
		
		return this.mID.hashCode();
	}

	/**
	 * @return the mID
	 */
	public String getID() {
		return mID;
	}

	/**
	 * @return the mName
	 */
	public String getName() {
		return mName;
	}

	/**
	 * @return the mDescription
	 */
	public String getDescription() {
		return mDescription;
	}

	/**
	 * @return the mIcon
	 */
	public Sprite getIcon() {
		return mIcon;
	}
	
	@Override
	public boolean equals(Object o) {
		
		if(o instanceof AbsBaseResourceType){
			
			return this.mID.equals(((AbsBaseResourceType) o).getID());
		
		}else{
					
			return super.equals(o);
		}
	}
}
